

import 'package:flutter/material.dart';

// import '../constant/constant.dart';

// ignore: must_be_immutable
class SemiCircle extends StatelessWidget {
  double height;
  SemiCircle({required this.height, super.key});

  @override
  Widget build(BuildContext context) {
    return ClipPath(
      clipper: SemicircleClipper(),
      child: Container(
        height: height,
        decoration: const BoxDecoration(
          gradient: LinearGradient(
            begin: Alignment.topCenter,
            end: Alignment.bottomCenter,
            colors: [Colors.white, Colors.white],
          ),
        ),
      ),
    );
  }
}

class SemicircleClipper extends CustomClipper<Path> {
  @override
  Path getClip(Size size) {
    double w = size.width;
    double h = size.height;

    final path = Path();

    path.lineTo(0, h - 50);
    // path.quadraticBezierTo(w * 0.5, h - 100, w, h);
    path.quadraticBezierTo(w * 0.5, h + 50, w, h - 50);
    path.lineTo(w, 0);

    path.close();
    return path;
  }

  @override
  bool shouldReclip(covariant CustomClipper<Path> oldClipper) {
    return false;
  }
}
